<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .bigbox{
            position: absolute;
            top: 20%;
            left: 10%;
            font-size: 70px;
        }
        .box{
            width: 300px;
            height: 20px;
            border: 1px solid #000;
        }
        .load{
            width: 0;
            height: 20px;
            background-color: red;
        }
    </style>
</head>
<body>
    <div class="bigbox">
        <div class="box">
            <div class="load"></div>
        </div>
        <span class="su"></span>
    </div>
</body>
<script>
    var load = document.querySelector('.load')
    var su = document.querySelector('.su')
    var i = 0;
    var timer = setInterval(function(){
        if(i<100){
            i++
            load.style.width = i*3 + 'px'
            su.innerText = i + '%'
        }if(i>=100){
            clearInterval(timer)
            location.href = "http://www.baidu.com"
        }
    },100)
</script>
</html>